package com.teamcenter.rac.massupdate.model;

import java.util.List;

import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.PropertyDescriptor;

import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.massupdate.providers.UpdateResultLabelProvider;
import com.teamcenter.rac.massupdate.utils.SourceHelper;
@SuppressWarnings({"unused","rawtypes","unchecked"})
public class UpdateResult
  extends AbstractWrappedPropertySource
  implements ISubmitToWorkflowRow
{
  public static final String PROP_IMPACTED_PART = "impactedPart";
  public static final String PROP_RESULT_COMMENT = "resultComment";
  public static final String PROP_RESULT_STATUS = "resultStatus";
private static final int NUM_LOCAL_PROP = 4;
  
  public UpdateResult()
  {
    super(4);
    this.m_localPropNames.add("impactedPart");
    this.m_localPropNames.add("resultComment");
    this.m_localPropNames.add("resultStatus");
    this.m_localPropNames.add("selected");
  }
  
  public IPropertySource getImpactedPart()
  {
    return (IPropertySource)getPropertyValue("impactedPart");
  }
  
  public IPropertyDescriptor[] getPropertyDescriptors()
  {
    if (this.m_propertyDescriptors == null)
    {
      List localList = getWrappedPropertyDescriptors(4);
      PropertyDescriptor localPropertyDescriptor1 = new PropertyDescriptor("impactedPart", Messages.UpdateResult_Prop_ImpactedPart);
      PropertyDescriptor localPropertyDescriptor2 = new PropertyDescriptor("resultComment", Messages.UpdateResult_Prop_Comment);
      PropertyDescriptor localPropertyDescriptor3 = new PropertyDescriptor("resultStatus", Messages.UpdateResult_Prop_Status);
      localPropertyDescriptor1.setLabelProvider(new UpdateResultLabelProvider("impactedPart"));
      localPropertyDescriptor2.setLabelProvider(new UpdateResultLabelProvider("resultComment"));
      localPropertyDescriptor3.setLabelProvider(new UpdateResultLabelProvider("resultStatus"));
      localList.add(localPropertyDescriptor1);
      localList.add(localPropertyDescriptor2);
      localList.add(localPropertyDescriptor3);
      this.m_propertyDescriptors = ((IPropertyDescriptor[])localList.toArray(new IPropertyDescriptor[localList.size()]));
    }
    return this.m_propertyDescriptors;
  }
  
  public String getResultComment()
  {
    return (String)getPropertyValue("resultComment");
  }
  
  public int getResultStatus()
  {
    return ((Integer)getPropertyValue("resultStatus")).intValue();
  }
  
  public void setImpactedPart(IPropertySource paramIPropertySource)
  {
    setWrappedPropertySource(paramIPropertySource);
    updateAndAnnounceProperty("impactedPart", paramIPropertySource);
  }
  
  public void setResultComment(String paramString)
  {
    updateAndAnnounceProperty("resultComment", paramString);
  }
  
  public void setResultStatus(int paramInt)
  {
    updateAndAnnounceProperty("resultStatus", Integer.valueOf(paramInt));
  }
  
  public void setSelected(boolean paramBoolean)
  {
    setPropertyValue("selected", Boolean.valueOf(paramBoolean));
  }
  
  public boolean isSelected()
  {
    return getPropertyValueAsBoolean("selected");
  }
  
  public Object getIdentifier()
  {
    return getPropertyValue("UID");
  }
  
  public Object getData()
  {
    return this;
  }
  
  public Object getValue(String paramString)
  {
    if (paramString.equals("resultStatus"))
    {
      int i = getResultStatus();
      return UpdateResultStatus.fromIntToString(i);
    }
    return getPropertyValue(paramString);
  }
  
  public void setValue(String paramString, Object paramObject)
  {
    setPropertyValue(paramString, paramObject);
  }
  
  public TCComponent getComponent()
  {
    return SourceHelper.getAssociatedComponent(getImpactedPart(), getTCSession());
  }
  
  public static enum UpdateResultStatus
  {
    FAIL,  SUCCESS;
    
    public static String fromIntToString(int paramInt)
    {
      switch (paramInt)
      {
      case 0: 
        return Messages.UpdateResult_Status_Success;
      }
      return Messages.UpdateResult_Status_Fail;
    }
  }
}


/* Location:              D:\下载\Fw_ 金卡反编译需求\com.teamcenter.rac.massupdate_11000.2.0.jar!\com\teamcenter\rac\massupdate\model\UpdateResult.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */